/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-05-22 23:03:13
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-05-23 00:49:41
 * @FilePath: \vue3_nuxt_demo\store\myStore.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {defineStore} from 'pinia';

export const useMyStore = defineStore('myStore', {
  state: () => {
    return {
      count: 0
    };
  },
  getters: {
    doubleCount: (state) => state.count * 2
  },
  actions: {
    add() {
      this.count++;
    }
  },
  persist: {
    storage: persistedState.cookiesWithOptions()
  },
})